package com.lsx.logisticscore.controller;

import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.lsx.logistics.response.CommonResp;
import com.lsx.logisticscore.entity.Log;
import com.lsx.logisticscore.mapper.LogMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/log")
public class LogController {
    @Autowired
    LogMapper logMapper;

    @RequestMapping("/list")
    public CommonResp<List<Log>> getLogs(String ticketId){
        QueryWrapper<Log> wrapper = new QueryWrapper<>();
        wrapper.eq("ticket_id", ticketId);
        return new CommonResp<>(logMapper.selectList(wrapper));
    }
}

